# -*- encoding=utf8 -*-
__author__ = "fq"

from airtest.core.api import *

auto_setup(__file__)



y=0
while y<10000:
    
    
    #1
    if exists(Template(r"tpl1-4-11.png", threshold=0.9500000000000002, record_pos=(0.317, -0.088), resolution=(2160, 1080))):
        sleep(2)
        touch((188,269))
        sleep(4)
        touch((180,405))
        sleep(15)
        
        sleep(3)
        touch((480,437))
        sleep(3)
        touch(Template(r"tpl1646295748435.png", record_pos=(0.409, 0.159), resolution=(2160, 1080)))
        sleep(10)
        wait(Template(r"tpl1646715509955.png", threshold=0.8, record_pos=(-0.454, -0.205), resolution=(2160, 1080)),timeout=480,interval=2)
        sleep(3)
        
        touch((140,500))
        sleep(3)
        touch((40,108))
        sleep(3)
        touch((400,22))
        sleep(3)
        touch((316,200),times=20,duration=0.1)
        sleep(3)
        touch((731,102))
        sleep(3) 
        touch((691,438))
        sleep(3)
        touch((691,438))
        sleep(3)
        touch((883,142))
        sleep(3)
        
        


        #次1


    elif exists(Template(r"tpl1-3-11.png", threshold=0.8999999999999999, record_pos=(-0.409, -0.014), resolution=(2160, 1080))):
        
        sleep(2)
        touch((715,178))
        sleep(4)
        touch((180,405))
        sleep(10)
        wait(Template(r"tpl1-3-12.png", record_pos=(-0.0, 0.017), resolution=(2160, 1080)),timeout=30)
        sleep(3)
        touch((480,437))
        sleep(3)
        touch(Template(r"tpl1646295748435.png", record_pos=(0.409, 0.159), resolution=(2160, 1080)))
        sleep(10)
        wait(Template(r"tpl1646715509955.png", threshold=0.8, record_pos=(-0.454, -0.205), resolution=(2160, 1080)),timeout=480,interval=2)
        sleep(3)
        
        touch((140,500))
        sleep(3)
        touch((40,108))
        sleep(3)
        touch((400,22))
        sleep(3)
        touch((316,200),times=20,duration=0.1)
        sleep(3)
        touch((731,102))
        sleep(3) 
        touch((691,438))
        sleep(3)
        touch((691,438))
        sleep(3)
        touch((883,142))
        sleep(3)
     
        
        #2
        



    elif exists(Template(r"tpl1-4-21.png", threshold=0.9000000000000001, record_pos=(0.011, -0.0), resolution=(2160, 1080))):
        sleep(2)
        touch((188,269))
        sleep(4)
        touch((388,405))
        sleep(20)
        
        sleep(3)
        touch((480,437))
        sleep(3)
        touch(Template(r"tpl1646295748435.png", record_pos=(0.409, 0.159), resolution=(2160, 1080)))
        sleep(10)
        wait(Template(r"tpl1646715509955.png", threshold=0.8, record_pos=(-0.454, -0.205), resolution=(2160, 1080)),timeout=480,interval=2)
        sleep(3)
        
        touch((140,500))
        sleep(3)
        touch((40,108))
        sleep(3)
        touch((400,22))
        sleep(3)
        touch((316,200),times=20,duration=0.1)
        sleep(3)
        touch((731,102))
        sleep(3) 
        touch((691,438))
        sleep(3)
        touch((691,438))
        sleep(3)
        touch((883,142))
        sleep(3)
        

        
    #3    
        
    elif exists(Template(r"tpl1-4-31.png", threshold=0.9500000000000002, record_pos=(-0.409, -0.008), resolution=(2160, 1080))):
        
        sleep(2)
        touch((188,269))
        sleep(4)
        touch((599,405))
        sleep(10)
        wait(Template(r"tpl1-4-32.png", threshold=0.8999999999999999, record_pos=(0.011, -0.0), resolution=(2160, 1080)),timeout=60)
        sleep(3)
        touch((480,437))
        sleep(3)
        touch(Template(r"tpl1646295748435.png", record_pos=(0.409, 0.159), resolution=(2160, 1080)))
        sleep(10)
        wait(Template(r"tpl1646715509955.png", threshold=0.8, record_pos=(-0.454, -0.205), resolution=(2160, 1080)),timeout=480,interval=2)
        sleep(3)
        
        touch((140,500))
        sleep(3)
        touch((40,108))
        sleep(3)
        touch((400,22))
        sleep(3)
        touch((316,200),times=20,duration=0.1)
        sleep(3)
        touch((731,102))
        sleep(3) 
        touch((691,438))
        sleep(3)
        touch((691,438))
        sleep(3)
        touch((883,142))
        sleep(3)
        
        
       
        
        

        
    #4    



    elif exists(Template(r"tpl1-4-41.png", threshold=0.8999999999999999, record_pos=(-0.04, -0.108), resolution=(2160, 1080))):
        
        sleep(2)
        touch((188,269))
        sleep(4)
        touch((805,405))
        sleep(25)
        sleep(3)
        touch((480,437))
        sleep(3)
        touch(Template(r"tpl1646295748435.png", record_pos=(0.409, 0.159), resolution=(2160, 1080)))
        sleep(10)
        wait(Template(r"tpl1646715509955.png", threshold=0.8, record_pos=(-0.454, -0.205), resolution=(2160, 1080)),timeout=480,interval=2)
        sleep(3)
        
        touch((140,500))
        sleep(3)
        touch((40,108))
        sleep(3)
        touch((400,22))
        sleep(3)
        touch((316,200),times=20,duration=0.1)
        sleep(3)
        touch((731,102))
        sleep(3) 
        touch((691,438))
        sleep(3)
        touch((691,438))
        sleep(3)
        touch((883,142))
        sleep(3)
        
        
        
        
        
        
        
    elif exists(Template(r"tpl1-3-11.png", threshold=0.8999999999999999, record_pos=(-0.409, -0.014), resolution=(2160, 1080))):
        
        sleep(2)
        touch((715,178))
        sleep(4)
        touch((180,405))
        sleep(10)
        wait(Template(r"tpl1-3-12.png", record_pos=(-0.0, 0.017), resolution=(2160, 1080)),timeout=30)
        sleep(3)
        touch((480,437))
        sleep(3)
        touch(Template(r"tpl1646295748435.png", record_pos=(0.409, 0.159), resolution=(2160, 1080)))
        sleep(10)
        wait(Template(r"tpl1646715509955.png", threshold=0.8, record_pos=(-0.454, -0.205), resolution=(2160, 1080)),timeout=480,interval=2)
        sleep(3)
        
        touch((140,500))
        sleep(3)
        touch((40,108))
        sleep(3)
        touch((400,22))
        sleep(3)
        touch((316,200),times=20,duration=0.1)
        sleep(3)
        touch((731,102))
        sleep(3) 
        touch((691,438))
        sleep(3)
        touch((691,438))
        sleep(3)
        touch((883,142))
        sleep(3)

                        


        
        


        
    else:
            sleep(3)
            touch((900,23))
            sleep(3)
            touch((140,500))
            sleep(3)
            touch((40,108))
            sleep(3)
            touch((400,22))
            sleep(3)
            touch((316,200),times=20,duration=0.1)
            sleep(3)
            touch((731,102))
            sleep(3)
            touch((883,142))
            sleep(3)
            touch((883,142))
            sleep(10)
            

            

    y=y+1

    

